package com.ruoyi.hospital.service.impl;

import java.util.List;
import com.ruoyi.common.core.utils.DateUtils;
import com.ruoyi.hospital.domain.YlLabel;
import com.ruoyi.hospital.mapper.YlLabelMapper;
import com.ruoyi.hospital.service.IYlLabelService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

/**
 * 标签信息Service业务层处理
 * 
 * @author ruoyi
 * @date 2022-02-16
 */
@Service
public class YlLabelServiceImpl implements IYlLabelService
{
    @Autowired
    private YlLabelMapper ylLabelMapper;

    /**
     * 查询标签信息
     * 
     * @param labelId 标签信息主键
     * @return 标签信息
     */
    @Override
    public YlLabel selectYlLabelByLabelId(Long labelId)
    {
        return ylLabelMapper.selectYlLabelByLabelId(labelId);
    }

    /**
     * 查询标签信息列表
     * 
     * @param ylLabel 标签信息
     * @return 标签信息
     */
    @Override
    public List<YlLabel> selectYlLabelList(YlLabel ylLabel)
    {
        return ylLabelMapper.selectYlLabelList(ylLabel);
    }

    @Override
    public List<YlLabel> selectAll() {
        return ylLabelMapper.selectAll();
    }

    /**
     * 新增标签信息
     * 
     * @param ylLabel 标签信息
     * @return 结果
     */
    @Override
    public int insertYlLabel(YlLabel ylLabel)
    {
        ylLabel.setCreateTime(DateUtils.getNowDate());
        return ylLabelMapper.insertYlLabel(ylLabel);
    }

    /**
     * 修改标签信息
     * 
     * @param ylLabel 标签信息
     * @return 结果
     */
    @Override
    public int updateYlLabel(YlLabel ylLabel)
    {
        ylLabel.setUpdateTime(DateUtils.getNowDate());
        return ylLabelMapper.updateYlLabel(ylLabel);
    }

    /**
     * 批量删除标签信息
     * 
     * @param labelIds 需要删除的标签信息主键
     * @return 结果
     */
    @Override
    public int deleteYlLabelByLabelIds(Long[] labelIds)
    {
        return ylLabelMapper.deleteYlLabelByLabelIds(labelIds);
    }

    /**
     * 删除标签信息信息
     * 
     * @param labelId 标签信息主键
     * @return 结果
     */
    @Override
    public int deleteYlLabelByLabelId(Long labelId)
    {
        return ylLabelMapper.deleteYlLabelByLabelId(labelId);
    }
}
